home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / CPL.H < prev    next >
C/C++ Source or Header  |  1993-11-23  |  6KB  |  158 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * cpl.h -       Control panel extension DLL definitions                       *
  4. *                                                                             *
  5. *               Version 3.10                                                  *
  6. *                                                                             *
  7. *               Copyright (c) 1992, Microsoft Corp.  All rights reserved      *
  8. *                                                                             *
  9. ******************************************************************************
  10. *  General rules for being installed in the Control Panel:
  11. *
  12. *      1) The DLL must export a function named CPlApplet which will handle
  13. *         the messages discussed below.
  14. *      2) If the applet needs to save information in CONTROL.INI minimize
  15. *         clutter by using the application name [MMCPL.appletname].
  16. *      2) If the applet is refrenced in CONTROL.INI under [MMCPL] use
  17. *         the following form:
  18. *              ...
  19. *              [MMCPL]
  20. *              uniqueName=c:\mydir\myapplet.dll
  21. *              ...
  22. *
  23. *
  24. *  The order applet DLL's are loaded by CONTROL.EXE is:
  25. *
  26. *      1) MAIN.CPL is loaded from the windows system directory.
  27. *
  28. *      2) Installable drivers that are loaded and export the
  29. *         CplApplet() routine.
  30. *
  31. *      3) DLL's specified in the [MMCPL] section of CONTROL.INI.
  32. *
  33. *      4) DLL's named *.CPL from windows system directory.
  34. *
  35. */
  36. #ifndef _INC_CPL
  37. #define _INC_CPL
  38.  
  39. #ifndef RC_INVOKED
  40. #pragma pack(1)         /* Assume byte packing throughout */
  41. #endif /* RC_INVOKED */
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {            /* Assume C declarations for C++ */
  45. #endif    /* __cplusplus */
  46.  
  47. /*
  48.  * CONTROL.EXE will answer this message and launch an applet
  49.  *
  50.  * WM_CPL_LAUNCH
  51.  *
  52.  *      wParam      - window handle of calling app
  53.  *      lParam      - LPSTR of name of applet to launch
  54.  *
  55.  * WM_CPL_LAUNCHED
  56.  *
  57.  *      wParam      - TRUE/FALSE if applet was launched
  58.  *      lParam      - NULL
  59.  *
  60.  * CONTROL.EXE will post this message to the caller when the applet returns
  61.  * (ie., when wParam is a valid window handle)
  62.  *
  63.  */
  64. #define WM_CPL_LAUNCH   (WM_USER+1000)
  65. #define WM_CPL_LAUNCHED (WM_USER+1001)
  66.  
  67. /* A function prototype for CPlApplet() */
  68.  
  69. typedef LRESULT (CALLBACK *APPLET_PROC)(HWND hwndCpl, UINT msg, LPARAM lParam1, LPARAM lParam2);
  70.  
  71. /* The data structure CPlApplet() must fill in. */
  72.  
  73. typedef struct tagCPLINFO
  74. {
  75.     int     idIcon;     /* icon resource id, provided by CPlApplet() */
  76.     int     idName;     /* name string res. id, provided by CPlApplet() */
  77.     int     idInfo;     /* info string res. id, provided by CPlApplet() */
  78.     LONG    lData;      /* user defined data */
  79. } CPLINFO, *PCPLINFO, FAR *LPCPLINFO;
  80.  
  81. typedef struct tagNEWCPLINFO
  82. {
  83.     DWORD       dwSize;         /* similar to the commdlg */
  84.     DWORD    dwFlags;
  85.     DWORD       dwHelpContext;  /* help context to use */
  86.     LONG        lData;          /* user defined data */
  87.     HICON       hIcon;          /* icon to use, this is owned by CONTROL.EXE (may be deleted) */
  88.     char        szName[32];     /* short name */
  89.     char        szInfo[64];     /* long name (status line) */
  90.     char        szHelpFile[128];/* path to help file to use */
  91. } NEWCPLINFO, *PNEWCPLINFO, FAR *LPNEWCPLINFO;
  92.  
  93.  
  94. /* The messages CPlApplet() must handle: */
  95.  
  96. #define CPL_INIT        1
  97. /*  This message is sent to indicate CPlApplet() was found. */
  98. /*  lParam1 and lParam2 are not defined. */
  99. /*  Return TRUE or FALSE indicating whether the control panel should proceed. */
  100.  
  101.  
  102. #define CPL_GETCOUNT    2
  103. /*  This message is sent to determine the number of applets to be displayed. */
  104. /*  lParam1 and lParam2 are not defined. */
  105. /*  Return the number of applets you wish to display in the control */
  106. /*  panel window. */
  107.  
  108.  
  109. #define CPL_INQUIRE     3
  110. /*  This message is sent for information about each applet. */
  111. /*  lParam1 is the applet number to register, a value from 0 to */
  112. /*  (CPL_GETCOUNT - 1).  lParam2 is a far ptr to a CPLINFO structure. */
  113. /*  Fill in CPL_INFO's idIcon, idName, idInfo and lData fields with */
  114. /*  the resource id for an icon to display, name and description string ids, */
  115. /*  and a long data item associated with applet #lParam1. */
  116.  
  117.  
  118. #define CPL_SELECT      4
  119. /*  This message is sent when the applet's icon has been clicked upon. */
  120. /*  lParam1 is the applet number which was selected.  lParam2 is the */
  121. /*  applet's lData value. */
  122.  
  123.  
  124. #define CPL_DBLCLK      5
  125. /*  This message is sent when the applet's icon has been double-clicked */
  126. /*  upon.  lParam1 is the applet number which was selected.  lParam2 is the */
  127. /*  applet's lData value. */
  128. /*  This message should initiate the applet's dialog box. */
  129.  
  130.  
  131. #define CPL_STOP        6
  132. /*  This message is sent for each applet when the control panel is exiting. */
  133. /*  lParam1 is the applet number.  lParam2 is the applet's lData  value. */
  134. /*  Do applet specific cleaning up here. */
  135.  
  136.  
  137. #define CPL_EXIT        7
  138. /*  This message is sent just before the control panel calls FreeLibrary. */
  139. /*  lParam1 and lParam2 are not defined. */
  140. /*  Do non-applet specific cleaning up here. */
  141.  
  142.  
  143. #define CPL_NEWINQUIRE    8
  144. /* this is the same as CPL_INQUIRE execpt lParam2 is a pointer to a */
  145. /* NEWCPLINFO structure.  this will be sent before the CPL_INQUIRE */
  146. /* and if it is responed to (return != 0) CPL_INQUIRE will not be sent */
  147.  
  148.  
  149. #ifdef __cplusplus
  150. }
  151. #endif    /* __cplusplus */
  152.  
  153. #ifndef RC_INVOKED
  154. #pragma pack()
  155. #endif  /* RC_INVOKED */
  156.  
  157. #endif  /* _INC_CPL */
  158.